# Contributor: Milan P. Stanić <mps@arvanta.net>
# Maintainer: Milan P. Stanić <mps@arvanta.net>
pkgname=speakersafetyd
pkgver=0.1.9
pkgrel=0
pkgdesc="asahi linux speaker safety daemon"
url="https://github.com/AsahiLinux/speakersafetyd"
arch="aarch64"
license="MIT"
depends="alsa-ucm-conf-asahi"
makedepends="alsa-lib-dev cargo cargo-auditable"
subpackages="$pkgname-openrc"
source="$pkgname-$pkgver.tar.gz::https://github.com/AsahiLinux/speakersafetyd/archive/refs/tags/$pkgver.tar.gz
	speakersafetyd.initd
	"

prepare() {
	default_prepare
	cargo update -p speakersafetyd
	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release
}

package() {
	make DESTDIR=$pkgdir install
	install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
}

sha512sums="
b237da8d473a89f6cd93c4cc0bef4a5402688c9e6528c54838abeec1d99ec615f69da29483689312da288cd4c4c0186951f60407d8c743d7bdc5a3c1a293fead  speakersafetyd-0.1.9.tar.gz
d577e5c96f240198bd1adff609944c678e725bd6db3378711f3e02d9cad1d6c058d0031c4aa5c91445d63ead6b037ebcffe377f764ba11261e05d72a73f77f7b  speakersafetyd.initd
"
